from sqlalchemy import ForeignKey

from app import db


class Food(db.Model):
    __table_args__ = {
        'mysql_engine': 'InnoDB',
        'mysql_charset': 'utf8'
    }
    restaurant_id = db.Column(db.String(50), ForeignKey('restaurant.restaurant_id'))
    food_id = db.Column(db.String(50), primary_key=True)
    food_name = db.Column(db.String(100))
    image_path = db.Column(db.String(255))
    price = db.Column(db.DECIMAL(10, 2))
    number = db.Column(db.Integer)
    description = db.Column(db.String(255))
    satisfaction = db.Column(db.DECIMAL(10, 2))
    food = db.relationship('Food', backref='restaurant')
